<script language=vbscript>
Function GetRnd()
lowerNum=1
upperNum = document.lotto.maxnum.value
Dim unit,RndNum,Fun_X
unit = upperNum - lowerNum
Redim MyArray(unit)
Redim outmarr(unit)
For Fun_I=0 To unit
myArray(Fun_I)= lowerNum + Fun_I
Next
For Fun_I=0 To round(unit)
RndNum = getRndNumber(Fun_I,unit)
Fun_X = myArray(RndNum)
myArray(RndNum)=myArray(Fun_I)
myArray(Fun_I)=Fun_X
Next
For i=0 to upperNum
document.write MyArray(i)&"<br>"
Next
End Function
Function getRndNumber(lowerbound,upperbound)
Randomize
getRndNumber=Int((upperbound-lowerbound+1)*Rnd+lowerbound)
End Function
</script>
<form name="lotto">
<table width=100% border=0>
<tr>
<td align=center>
<br>请输入要产生的最大数字： <input type=text name=maxnum value="100" size=4 maxlength=4><br><br><br><br>
<input type=button value="产生随机数" onClick="GetRnd()">
<p>
</td>
</tr>
</table>
</form>